<template>
  <div class="login-and-register" v-if="isshow">
    <div class="content">
      <!-- 左边信息展示 -->
      <div class="left-info">
        <div class="desc">
          <div class="fuwu_div">
            <p><i class="iconfont iconhuo"></i> 只需一步极速注册</p>
            <p><i class="iconfont iconhuo"></i> 唐哥博客提供精良的资源</p>
            <p><i class="iconfont iconhuo"></i> 匠心打磨，优质服务</p>
            <p><i class="iconfont iconhuo"></i> 打造王牌精英</p>
          </div>
        </div>
      </div>
      <!-- 右边用户可输入信息 -->
      <div class="write-info">
          <!-- <Register></Register> -->
          <!-- <Login></Login> -->
          <router-view name="lr"></router-view>
      </div>
    </div>
  </div>
</template>

<script>
import Register from '@/components/loginAndregister/register.vue'
import Login from '@/components/loginAndregister/login.vue'
import pubsub from "pubsub-js";
export default {
  name: "LoginAndRegisterjiagou",
  data() {
    return {
      isshow:true
    }
  },
  components:{
      Register,
      Login
  },
  mounted(){
    this.pub = pubsub.subscribe("leave", (nsgName, data) => {
            this.isshow = data
          });
           this.pub = pubsub.subscribe("loginandregister", (nsgName, data) => {
            this.isshow = data
          });
  }
};
</script>

<style scpoed>
.login-and-register {
  width: 100%;
  height: 100%;
  background: rgba(52, 52, 52, 0.5);
  position: fixed;
  top: 0;
  /* display: none; */
  z-index: 999;
}
.content {
  width: 40%;
  /* height: 100%; */
  /* border: 1px solid blue; */
  position: absolute;
  
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: flex;
}
.left-info {
  width: 45%;
  /* height: 100%; */
  /* border: 1px solid red; */
  background: linear-gradient(314deg,#14406d 0%,#5598cf 100%);
    border-radius: 20px 0 0 20px;
    position: relative;
}
.write-info {
  width: 55%;
  height: 100%;
  /* border: 1px solid green; */
}
.desc{
     position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}
 .desc p {
    font-size: 14px;
    font-weight: 500;
    color: #fff;
    line-height: 20px;
    margin-bottom: 24px;
}
</style>